<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>合同详情</title>
</head>
<link rel="stylesheet" href="/static/layui/css/layui.css" />
<body>
<form class="layui-form"  action="" lay-filter="edit">
    <div class="layui-form-item">
        <label class="layui-form-label">房屋名称：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="h_estate" id="h_estate"  required  lay-verify="required" placeholder="请输入房屋名称" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">租户名称：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="l_name" id="l_name"  required  lay-verify="required" placeholder="请输入租户名称" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">合同签署时间：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="c_time" id="c_time"  required  lay-verify="required" placeholder="请输入合同签署时间" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">合同生效时间：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="c_taketime" id="c_taketime"  required  lay-verify="required" placeholder="请输入合同生效时间" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">合同失效时间：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="c_overtime" id="c_overtime"  required  lay-verify="required" placeholder="请输入合同失效时间" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">总金额：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="c_rental" id="c_rental"  required  lay-verify="required" placeholder="请输入总金额" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">押金：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="c_cash" id="c_cash"  required  lay-verify="required" placeholder="请输入押金" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">签署人：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="c_name" id="c_name"  required  lay-verify="required" placeholder="请输入签署人" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">房屋状态:</label>
        <div class="layui-input-block">
            <input type="radio" name="c_status" value="0" title="未出租">
            <input type="radio" name="c_status" value="1" title="已出租" checked>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
        </div>
    </div>
</form>
</body>
<script src="/static/js/system.js"></script>
<script src="/js/jquery-3.4.1.min.js"></script>
<script src="/static/layui/layui.js"></script>
<script>
    $(function () {
        $("input").prop("disabled","disabled");
    })
    layui.use(['form','layer'], function(){
        var form = layui.form;
        $.ajax({
            url:'/UserServlet?action=shId',
            type:"post",
            dataType:"json",
            data:{"c_id":getQueryString("c_id")},
            success:function (da) {
                console.log(da)
                if (da.code == 200) {
                    // form.val("edit", da.date);
                    form.val("edit", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
                        "h_estate": da.date.h_estate+da.date.h_unitNumber+da.date.h_roomNo // "name": "value"
                        ,"l_name": da.date.l_name
                        ,"c_time": layui.util.toDateString(da.date.c_time, 'yyyy-MM-dd')
                        ,"c_taketime": layui.util.toDateString(da.date.c_taketime, 'yyyy-MM-dd')
                        ,"c_overtime": layui.util.toDateString(da.date.c_overtime, 'yyyy-MM-dd')
                        ,"c_rental": da.date.c_rental
                        ,"c_cash": da.date.c_cash
                        ,"c_name": da.date.c_name
                        ,"c_status": da.date.c_status
                    });
                } else {
                    parent.layer.msg("详情查询失败！");
                }
            }
        });
    });

</script>
</html>